Provides access to the user agent parser
Properties
Name | Returns | Notes | Example |
---|---|---|---|
userAgent | ReadableUserAgent | Tries to get the user agent from the current request and parse it. If there is no current request or user agent string null is returned. | |
userAgentAsJsonObject | JSONObject | Tries to get the user agent from the current request and parse it. If there is no current request or user agent string null is returned. | |
userAgentAsJson | String | Tries to get the user agent from the current request and parse it. If there is no current request or user agent string null is returned. |
Methods
Name | Returns | Notes | Example |
---|---|---|---|
parse ( userAgent ) | ReadableUserAgent | Parse a user agent string for e.g.: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36 | |
parseAsJson ( userAgent ) | String | Parse the user agent and return the results and a JSON string | |
parseAsJsonObject ( userAgent ) | JSONObject | Parse the user agent and return the results and a JSON Object | |
getUserAgent ( ) | ReadableUserAgent | Tries to get the user agent from the current request and parse it. If there is no current request or user agent string null is returned. | |
getUserAgentAsJsonObject ( ) | JSONObject | Tries to get the user agent from the current request and parse it. If there is no current request or user agent string null is returned. | |
getUserAgentAsJson ( ) | String | Tries to get the user agent from the current request and parse it. If there is no current request or user agent string null is returned. |
Hide comments
